﻿@page
@using MyHellCalendar.Web.Pages;
@using System.IO;
@model IndexModel
@{
    ViewData["Title"] = "Home page";

    var jsonstr = "";
    if (Model != null && Model.HellInfos!=null)
    {
        var itemList = new List<string>();
        foreach (var item in Model.HellInfos.Roles)
        {
            itemList.Add($"{{ \"name\" : \"{item.Name}\" , \"hellstone\" : {item.HellStone}}}");
        }
        jsonstr = "[" + string.Join(",", itemList) + "]";
    }
}
<head>
    <title>深渊日历</title>
    <link href="~/css/calendar.css" rel="stylesheet" />
    <script src="~/lib/jquery/dist/jquery.js"></script>
    <script type="text/javascript">
        var hellinfo = JSON.parse('@Html.Raw(jsonstr)');
    </script>
    <script src="~/js/calendar.js"></script>
</head>

<body>
    <div id="calendar" class="calendar"></div>
</body>